for y = 1, self.height do
				for x = 1, self.width do
					if y == 1 or x == 1 or
						y == self.height or x == self.width then
						self.layout[y][x] = self.space_type
					end

					if y == 2 or x == 2 or
						y == self.height-1 or x == self.width-1 then

						if self.layout[y][x] ~= self.space_type then
							self.layout[y][x] = self.wall_type 
						end

						if y == 2 then
							if self.layout[y+1][x] == self.space_type then
								self.layout[y][x] = self.space_type
							end
						end

						if x == 2 then
							if self.layout[y][x+1] == self.space_type then
								self.layout[y][x] = self.space_type
							end
						end

						if y == self.height-1 then
							-- this is y+1 in moai, might be a bug but not sure
							if self.layout[y-1][x] == self.space_type then
								self.layout[y][x] = self.space_type
							end
						end

						if x == self.width-1 then
							if self.layout[y][x-1] == self.space_type then
								self.layout[y][x] = self.space_type
							end
						end
					end

				end
			end